//
//  AFNRequest.h
//  PB
//
//  Created by bigger on 16/11/28.
//  Copyright © 2016年 BiggerFitness. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface AFNRequest : NSObject

/**
 *  发送一个POST请求
 *
 *  @param url     请求路径
 *  @param params  请求参数
 *  @param success 请求成功后的回调
 *  @param failure 请求失败后的回调
 */
+ (void)postWithURL:(NSString *)url params:(NSDictionary *)params success:(void (^)(id json))success failure:(void (^)(NSError *error))failure;

+ (void)cookPostWithURL:(NSString *)url params:(NSDictionary *)params success:(void (^)(id json))success failure:(void (^)(NSError *error))failure;

/**
 *  发送一个GET请求
 *
 *  @param url     请求路径
 *  @param params  请求参数
 *  @param success 请求成功后的回调
 *  @param failure 请求失败后的回调
 */
+ (void)getWithURL:(NSString *)url params:(NSDictionary *)params success:(void (^)(id json))success failure:(void (^)(NSError *error))failure;

+ (void)cookGetWithURL:(NSString *)url params:(NSDictionary *)params success:(void (^)(id json))success failure:(void (^)(NSError *error))failure;

// 图片上传
+ (void)postImageWithURL:(NSString *)url params:(NSDictionary *)params ImageData:(NSData *)imageData success:(void (^)(id json))success failure:(void (^)(NSError *error))failure;

// 文件上传
+ (void)postDataWithURL:(NSString *)url params:(NSDictionary *)params uploadData:(NSData *)uploadData dataType:(NSString *)dataType  success:(void (^)(id json))success failure:(void (^)(NSError *error))failure;
@end
